home *** CD-ROM | disk | FTP | other *** search
- Path: unix1.sncc.lsu.edu!eenaya
- From: eenaya@unix1.sncc.lsu.edu (Pradeep Nayar)
- Newsgroups: comp.lang.c
- Subject: Re:strings
- Date: 1 Feb 1996 21:15:51 GMT
- Organization: Louisiana State University
- Message-ID: <4erai7$20uc@sp115.ocs.lsu.edu>
- NNTP-Posting-Host: unix1-t.sncc.lsu.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- As most of you guys pointed out, the decleration should have been
-
- char str ; /* instead of char *str */
-
- so now,
- str = "hello world"[10] ; /* would be the character 'd' */
-
- it is the same as -
-
- char *str ;
- char ch ;
-
- str = "hello world" ;
- ch = str[10] ;
-
- Sorry about the mistake and thanks to all you guys for posting you replies.
- Pradeep Nayar
-